<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateInsureLogsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('insure_logs', function (Blueprint $table) {
            $table->id();
            $table->integer('car_id')->default(0)->comment('车辆id');
            $table->string('pdf1')->default('')->comment('上传商业险文件');
            $table->string('pdf2')->default('')->comment('上传交强险文件');
            $table->string('purchase_tax')->default('')->comment('购置税');
            $table->timestamp('si_last_time')->comment('下次保险时间');
            $table->timestamp('ci_last_time')->comment('下次交强险时间');
            $table->string('company_name')->default('')->comment('公司名称');
            $table->decimal('insurance_premium',10,2)->default(0.00)->comment('保险费用');
            $table->timestamps();

        });
        \DB::statement("ALTER TABLE `insure_logs` comment '保险记录'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('insure_logs');
    }
}
